<template>
  <section style="padding:20px 80px 0px 8px;">
    <el-row :gutter="12">
      <el-col v-for="item in this.$store.getters.menukjList" :key="item.id" :span="3">
        <el-card shadow="always" class="qt qtbk" style="cursor: pointer;" @click.native="getDictionaries(item.url)">{{ item.name }}
          <el-popconfirm
            title="确定删除该页面快捷方式吗？"
            @onConfirm="removeKey(item.id)"
          >
            <div style="text-align: right; margin: 0">
              <el-button size="mini" type="text" @click="item.visible = false">取消</el-button>
              <el-button type="primary" size="mini" @click="item.visible = false">确定</el-button>
            </div>
            <div slot="reference" style="float: right; padding: 0px 0px" @click.stop="">
              <el-button type="text" style="color:#fff">移除</el-button>
            </div>
          </el-popconfirm>
        </el-card>
      </el-col>
    </el-row>
    <el-divider />
    <el-timeline>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>添加项目管理功能</h4>
          <h4>更新前端框架，使框架能支持ie11浏览器，及可在IIS7以上版本部署</h4>
          <p>yxx 提交于 2020-9-10</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>质量校验部分bug修复</h4>
          <h4>增加顶层菜单，目前未开放</h4>
          <p>yxx 提交于 2020-8-22</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>前端路由改为异步加载，提升加载效率，优化用户体验</h4>
          <h4>优化前端ui。</h4>
          <p>yxx 提交于 2020-8-22</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>添加质量校验，校验报告填写，确认等功能</h4>
          <h4>优化前端ui。</h4>
          <p>yxx 提交于 2020-8-20</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>实现通用的表格导出模块，支持excel,html,csv,xml等格式</h4>
          <h4>新增通用库存管理页面，实现库存简单汇总，明细查询。</h4>
          <p>yxx 提交于 2020-8-12</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>修改仓库设置相关页面的ui。</h4>
          <h4>新增通用库存出库页面，实现简单出库。</h4>
          <p>yxx 提交于 2020-8-9</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>修改物料类别的管理功能，增加库存管理用到的一些配置。</h4>
          <h4>新增通用库存入库页面，简单实现表格行内编辑。</h4>
          <p>yxx 提交于 2020-8-5</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>新增用户的域名字段，域用户名登陆验证</h4>
          <p>yxx 提交于 2020-8-3</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>修改 物料管理添加物料规格、最小发料数量、最小发料单位、客户编码字段</h4>
          <p>yxx 提交于 2020-7-29</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>修改 常用页面快速访问,添加手动增加,删除快捷方式</h4>
          <p>yxx 提交于 2020-7-28</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>新增 常用页面快速访问</h4>
          <h4>修改 新增修改表单验证</h4>
          <p>yxx 提交于 2020-7-24</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>新增 库位管理</h4>
          <h4>新增 物料管理</h4>
          <p>yxx 提交于 2020-7-24</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="版本 1.0.0" placement="top">
        <el-card>
          <h4>新增 类别管理</h4>
          <h4>新增 仓库管理</h4>
          <h4>重构 重构底层，添加租户模式，添加一个用户多个租户（工厂）</h4>
          <p>yxx 提交于 2020-7-23</p>
        </el-card>
      </el-timeline-item>
    </el-timeline>
    <el-backtop target=".container .main" :visibility-height="200" />
    <template>
      <el-backtop target=".el-main">
        <div class="el-icon-caret-top" />
      </el-backtop>
    </template>
  </section>
</template>

<script>
import { getMenukjList, removeMenukj } from '@/api/admin/home'
export default {
  name: 'Welcome',
  data() {
    return {
      list: []
    }
  },
  mounted() {
  },
  methods: {
    async getDictionaries(url) {
      this.$router.replace(url)
    },
    async initMenuKj() {
      const res = await getMenukjList()
      this.list = res.data
    },
    async removeKey(key) {
      const para = { id: key }
      const res = await removeMenukj(para)

      if (!res?.success) {
        return
      }
      this.$message({
        message: this.$t('admin.deleteOk'),
        type: 'success'
      })
      await this.$store.dispatch('user/initMenuKj')
    }
  }
}
</script>

<style scoped>
.qt{
  margin-bottom: 5px;
}
.qtbk {
    background: #409EFF;
    color:#fff;
    width: 100%;
    overflow: hidden;
    cursor: pointer;
}
h2,h3,h4,h5 {
    font-weight: 400;
    color: #1f2f3d;
    margin-top: 0px;
    margin-bottom: 10px;
}
p {
    font-size: 14px;
    color: #5e6d82;
    line-height: 1.5em;
    margin-bottom: 0px;
}
.el-timeline{
  padding-left: 15px;
}
</style>
